package com.blacktry.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.blacktry.entity.blog.ArticleLabel;
import com.blacktry.mapper.blog.ArticleLabelMapper;
import com.blacktry.service.ArticleLabelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author blackTry
 * @since 2022-02-07
 */
@Service
public class ArticleLabelServiceImpl extends ServiceImpl<ArticleLabelMapper, ArticleLabel> implements ArticleLabelService {
    @Override
    public void insertArticleLable(ArticleLabel articleLabel) {
        this.baseMapper.insert(articleLabel);
    }

    @Override
    public List<ArticleLabel> selectArticleLabelByArticleId(Integer articleId) {
        Wrapper<ArticleLabel> articleLabelWrapper=new QueryWrapper<>();
        articleLabelWrapper.equals(articleId);
        return this.baseMapper.selectList(articleLabelWrapper);
    }

    @Override
    public int deleteArticleLabel(Integer articleId) {
        return this.baseMapper.deleteById(articleId);
    }

    @Override
    public String selectLableNameById(Integer lableId) {
        return this.baseMapper.selectLableNameById(lableId);
    }

    @Override
    public Integer[] selectLabelIdByArticleId(Integer articleId) {
        return new Integer[0];
    }
}
